home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IO CD 2001 June
/
io cd 6-01 #1.bin
/
dema gier
/
Desperados - Wanted Dead or Alive
/
Web
/
ie_md8lib.js
< prev
next >
Wrap
Text File
|
2001-02-13
|
5KB
|
204 lines
/******************************************************************************
* File: ie_md8lib.js *
* *
* Copyright MatchWare A/S *
* Author: Jens ╪. Nielsen *
******************************************************************************/
function BrowserInit() {
}
function GetObjLeft( obj) {
return obj.style.pixelLeft;
}
function GetObjTop( obj) {
return obj.style.pixelTop;
}
function GetObjWidth( obj) {
if ( obj.style.pixelWidth)
return obj.style.pixelWidth;
else
return obj.clientWidth;
}
function GetObjHeight( obj) {
if ( obj.style.pixelHeight)
return obj.style.pixelHeight;
else
return obj.clientHeight;
}
function SetObjPosition( obj,left,top) {
obj.style.pixelLeft = left;
obj.style.pixelTop = top;
}
function IsObjVisible( obj) {
return obj.style.visibility == "visible";
}
function ShowObject( obj,visible) {
obj.style.visibility = visible ? "visible" : "hidden";
}
//------------------------------------
var PAGE_ACTION_POST_FIX = "_ie.htm";
//------------------------------------
var effects = new Array();
effects.BoxIn = 0;
effects.BoxOut = 1;
effects.CircleIn = 2;
effects.CircleOut = 3;
effects.WipeUp = 4;
effects.WipeDown = 5;
effects.WipeRight = 6;
effects.WipeLeft = 7;
effects.HorzBlinds = 9;
effects.Dissolve = 12;
effects.SplitVerticalIn = 13;
effects.Normal = 100;
effects.Fade = 101;
//------------------------------------
function HideAction( obj,duration,effecttype) {
this.m_Obj = obj;
this.m_Duration = duration;
this.m_EffectType = effecttype;
this.Start = HideAction_Start;
}
function HideAction_Start() {
if ( this.m_Obj.style.visibility == "hidden") return;
switch ( this.m_EffectType) {
case effects.Normal :
this.m_Obj.style.visibility = "hidden";
break;
case effects.Fade :
this.m_Obj.style.filter = "blendTrans(duration=" + (this.m_Duration / 1000) + ")";
this.m_Obj.filters.blendTrans.stop();
this.m_Obj.filters.blendTrans.apply();
this.m_Obj.style.visibility="hidden";
this.m_Obj.filters.blendTrans.play();
break;
default :
this.m_Obj.style.filter = "revealTrans(duration==" + (this.m_Duration / 1000) + ", transition=" + this.m_EffectType + ")";
this.m_Obj.filters.revealTrans.stop();
this.m_Obj.filters.revealTrans.apply();
this.m_Obj.style.visibility="hidden";
this.m_Obj.filters.revealTrans.play();
break;
}
}
//------------------------------------
function ShowAction( obj,duration,effecttype) {
this.m_Obj = obj;
this.m_Duration = duration;
this.m_EffectType = effecttype;
this.Start = ShowAction_Start;
}
function ShowAction_Start() {
if ( this.m_Obj.style.visibility == "visible") return;
switch ( this.m_EffectType) {
case effects.Normal :
this.m_Obj.style.visibility = "visible";
break;
case effects.Fade :
this.m_Obj.style.filter = "blendTrans(duration=" + (this.m_Duration / 1000) + ")";
this.m_Obj.filters.blendTrans.stop();
this.m_Obj.filters.blendTrans.apply();
this.m_Obj.style.visibility = "visible";
this.m_Obj.filters.blendTrans.play();
break;
default :
this.m_Obj.style.filter = "revealTrans(duration==" + (this.m_Duration / 1000) + ", transition=" + this.m_EffectType + ")";
this.m_Obj.filters.revealTrans.stop();
this.m_Obj.filters.revealTrans.apply();
this.m_Obj.style.visibility = "visible";
this.m_Obj.filters.revealTrans.play();
break;
}
}
//------------------------------------
function SoundAction( sound,repeat,cancelmidi,cancelwave) {
var pos = sound.lastIndexOf( ".");
var ext = sound.substring( pos).toLowerCase();
this.m_Sound = sound;
this.m_Repeat = repeat;
this.m_CancelMidi = cancelmidi;
this.m_CancelWave = cancelwave;
this.m_Midi = ext == ".mid";
this.Start = SoundAction_Start;
}
function SoundAction_Start() {
if ( window.parent == self) return;
if ( this.m_CancelMidi)
top.global.mediaplayer1.Stop();
if ( this.m_CancelWave)
top.global.mediaplayer2.Stop();
if ( this.m_Sound == "") return;
var player = this.m_Midi ? top.global.mediaplayer1 : top.global.mediaplayer2;
if ( player.PlayState == 2) return; // Already playing
player.FileName = this.m_Sound;
player.PlayCount = this.m_Repeat ? 0 : 1;
player.Volume = 0; // Full volume
player.Play();
}
//------------------------------------
function SetCursorAction( type) {
this.m_Type = type;
this.Start = SetCursorAction_Start;
}
function SetCursorAction_Start() {
var aDivs = document.body.all.tags("DIV");
if ( ! aDivs) return;
for ( var i=0;i < aDivs.length; i++)
aDivs( i).style.cursor = this.m_Type;
aDivs = document.body.all.tags("IMG");
if ( ! aDivs) return;
for ( var i=0;i < aDivs.length; i++)
aDivs( i).style.cursor = this.m_Type;
}
//------------------------------------